package cn.edu.xmu.orderpayment.payment.microservice.wechatpayvo;

import cn.edu.xmu.orderpayment.payment.model.bo.Amount;
import cn.edu.xmu.orderpayment.payment.util.config.payconfigs.WeChatPayConfig;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author ziyi guo
 * @date 2021/11/30
 */
@Data
@NoArgsConstructor
public class WeChatPayRefundVo {

    @NotBlank
    private String outTradeNo;

    @NotBlank
    private String outRefundNo;

    private String reason;

    private String notifyUrl;

    @NotNull
    private RefundAmountVo amount;

    public WeChatPayRefundVo(WeChatPayConfig weChatPayConfig, Amount amount,String out_trade_no, String out_refund_no, String reason){
        this.outTradeNo=out_trade_no;
        this.outRefundNo=out_refund_no;
        this.amount=new RefundAmountVo(amount);
        this.reason=reason;
        this.notifyUrl=weChatPayConfig.getRefundNotifyUrl();
    }
}
